package model.kml;

import util.StringUtils;

public class Placemark {
	
	private String id;
	private String name;
	private Boolean visibility = true;
	private String description;
	private String geomStr;
	private String styleUrl;
	
	public Placemark(){}
	
	public void addGeometry(String geom){
		this.geomStr = geom;
	}
	
	public String getGeometry(){
		return geomStr;
	}
	
	@Override
	public String toString(){
		String placeString = "";
		if(this.id != null) placeString = "<Placemark id=\""+this.id+"\">\n";
		else placeString = "<Placemark>";
		if(!StringUtils.isNullOrEmpty(this.name))
			placeString += "<name><![CDATA["+this.name+"]]></name>\n";
		placeString += "<visibility>"+this.visibility+"</visibility>\n";
		if(!StringUtils.isNullOrEmpty(styleUrl))
			placeString += "<styleUrl>"+this.styleUrl+"</styleUrl>\n";
		if(!StringUtils.isNullOrEmpty(this.description))
			placeString += "<description>"+this.description+"</description>\n";
		placeString += geomStr;
		placeString += "</Placemark>\n";
		return placeString;
			   
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getVisibility() {
		return visibility;
	}

	public void setVisibility(Boolean visibility) {
		this.visibility = visibility;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStyleUrl() {
		return styleUrl;
	}

	public void setStyleUrl(String styleUrl) {
		this.styleUrl = styleUrl;
	}

}
